package com.zkthink.ceres.applet.banner.controller;

import com.zkthink.base.R;
import com.zkthink.base.controller.SuperController;
import com.zkthink.clh.order.dto.ChlConfigPageDTO;
import com.zkthink.clh.order.dto.ChlConfigSaveDTO;
import com.zkthink.clh.order.dto.ChlConfigUpdateDTO;
import com.zkthink.clh.order.entity.ChlConfig;
import com.zkthink.clh.order.entity.ChlLbt;
import com.zkthink.zhl.order.service.ChlConfigService;
import com.zkthink.zhl.order.service.ChlOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author cmz
 * @Date 2024-04-27 9:27
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/applet/chlOrder")
@Api(value = "banner", tags = "轮播图")
public class BannerController {
    @Autowired
    private ChlConfigService chlConfigService;

    @Autowired
    private ChlOrderService chlOrderService;
    
    @ApiOperation("app轮播图")
    @GetMapping("/applist")
    public  R  applist(){
        return  R.success(chlOrderService.applist());
    }
    
    /*@ApiOperation(value = "后台查询轮播图", notes = "后台查询轮播图")
    @GetMapping(value = "/lbt")
    public R<List<ChlLbt>> lbt() {
        return R.success(chlConfigService.lbt());
    }*/
    
    @ApiOperation(value = "后台添加轮播图", notes = "后台添加轮播图")
    @PostMapping(value = "/addlbt")
    public R addlbt(@RequestBody ChlLbt chlLbt) {
        return R.success(chlConfigService.addlbt(chlLbt));
    }
    
    @ApiOperation(value = "后台删除轮播图", notes = "后台删除轮播图")
    @GetMapping(value = "/deletelbt/{id}")
    public R deletelbt(@PathVariable("id") Long id) {
        return R.success(chlConfigService.deletelbt(id));
    }
}
